import Loadable from 'react-loadable'
let loadable = (loader) => {
	return Loadable({
		loader,
		loading: () => {
			return <div>加载中</div>
		}
	})
}
let Home = loadable(() => import('../home'))
let Order = loadable(() => import('../order'))
let Department = loadable(() => import('../department'))
let Orderd = loadable(() => import('../orderd'))
let My = loadable(() => import('../my'))
let E404 = loadable(() => import('../E404'))

const routes = [
	{ path: '/home', title: '首页', component: Home },
	{ path: '/order', title: '点单', component: Order },
	{ path: '/department', title: '百货', component: Department },
	{ path: '/orderd', title: '订单', component: Orderd },
	{ path: '/My', title: '我的', component: My },
	{ from: '/', to: '/home' },
	{ to: '/E404' }
]
export default routes
